home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.0
/
Video Toaster v4.0.iso
/
arexx
/
modeler
/
nearbg.lwm
< prev
next >
Wrap
Text File
|
1993-12-13
|
944b
|
54 lines
/* CMD: Nearby Background
*
* Puts all nearby non-empty layers into the background of the current
* layers.
*/
mxx="LWModelerARexx.port"
signal on error
signal on syntax
mxx_add = addlib(mxx,0)
call main
if (mxx_add) then call remlib(mxx)
exit
syntax:
error:
t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
if (mxx_add) then call remlib(mxx)
exit
main:
emp = emptylayers()
cur = curlayer()
/* Keep adding adjacent layers to cur until all no more can
* be added.
*/
do until (nc = 0)
nc = 0
nl = ''
do i=1 to words(cur)
l = word(cur,i)
l1 = l + 1
if (l1<=8 & pos(l1,emp)=0 & pos(l1,cur nl)=0) then do
nl = nl l1
nc = nc + 1
end
l1 = l - 1
if (l1>0 & pos(l1,emp)=0 & pos(l1,cur nl)=0) then do
nl = nl l1
nc = nc + 1
end
end i
cur = cur nl
end
/* SetBLayer automatically masks out currently active layers,
* so passing cur is ok.
*/
call setblayer cur
return